[ZEPPELIN-6400] Remove ZeppelinConfiguration dependency from zeppelin-interpreter module#5167
[ZEPPELIN-6400] Remove ZeppelinConfiguration dependency from zeppelin-interpreter module#5167
Conversation
…-interpreter module Move ZeppelinConfiguration to zeppelin-zengine so it is no longer included in the shaded interpreter JAR. This prevents the Maven shade plugin from corrupting config string literals, which caused classpath- order-dependent configuration loading failures. Key changes: - Replace ZeppelinConfiguration usage in zeppelin-interpreter with Properties-based configuration - Update InterpreterLauncher, LifecycleManager, RecoveryStorage, DependencyResolver to accept Properties instead of ZeppelinConfiguration - Update all launcher plugins (Docker, K8s, YARN, Flink) accordingly - Move ZeppelinConfiguration.java and ZeppelinLocationStrategy.java from zeppelin-interpreter to zeppelin-zengine - Update callers in zeppelin-zengine, zeppelin-server, flink, and markdown interpreters Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FlexmarkParser now accepts Properties for better extensibility, instead of a single boolean escapeHtml parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onnectTimeout ZeppelinConfiguration parsed time values like "600s" internally, but after switching to Properties, the raw string is passed directly. Add parseTimeValue() to handle "s" (seconds) and "ms" (milliseconds) suffixes in timeout configuration values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…zengine Move server-side-only classes (InterpreterLauncher, InterpreterClient, InterpreterLaunchContext, RecoveryStorage, InterpreterLauncherTest) from zeppelin-interpreter to zeppelin-zengine. This allows launcher plugins and recovery storage to keep using ZeppelinConfiguration directly, eliminating unnecessary Properties conversion code. Reverts launcher plugins and zengine launcher/recovery files to their original ZeppelinConfiguration-based implementations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Long.parseLong() cannot parse values like "10s" that include time unit suffixes. Added parseTimeValue() method that handles plain numbers, "ms" suffix, and Duration-style formats (e.g., "10s", "1h") - matching the behavior of ZeppelinConfiguration.getTime(). This fixes the CI hang where TimeoutLifecycleManagerTest.testTimeout_2 entered an infinite "Wait for interpreter to be started" loop because the LifecycleManager constructor failed with NumberFormatException. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…um test Use clickAndWait() instead of clickableWait().click() when clicking the Bar Chart button, so the UI has time to update the active class before assertion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes ZeppelinConfiguration from the shaded zeppelin-interpreter module by migrating interpreter-side configuration to Properties, preventing shade-plugin string-literal corruption and classpath-order-dependent config failures.
Changes:
- Replaced
ZeppelinConfigurationusage in interpreter runtime paths withProperties(lifecycle managers, remote server, dependency resolution, markdown, Flink). - Updated
DependencyResolver/BooterAPIs to accept explicit proxy + Maven repo URL parameters instead ofZeppelinConfiguration. - Adjusted server/zengine callers and tests to use the new constructors and properties-based configuration.
Reviewed changes
Copilot reviewed 30 out of 37 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java | Switches remote interpreter server config from ZeppelinConfiguration to Properties, including defaults for key runtime settings. |
| zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/lifecycle/TimeoutLifecycleManager.java | Introduces properties-based timeout settings and new time parsing logic for lifecycle timeouts. |
| zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/SchedulerFactory.java | Replaces ZeppelinConfiguration static lookup with env/system-property based thread pool sizing. |
| zeppelin-interpreter/src/main/java/org/apache/zeppelin/dep/AbstractDependencyResolver.java | Refactors dependency resolution to take explicit proxy credentials and Maven repo URL. |
| markdown/src/main/java/org/apache/zeppelin/markdown/FlexmarkParser.java | Switches markdown HTML escaping config from ZeppelinConfiguration to a properties key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
...rpreter/src/main/java/org/apache/zeppelin/interpreter/lifecycle/TimeoutLifecycleManager.java
Show resolved
Hide resolved
...rpreter/src/main/java/org/apache/zeppelin/interpreter/lifecycle/TimeoutLifecycleManager.java
Show resolved
Hide resolved
...nterpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
Show resolved
Hide resolved
zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/SchedulerFactory.java
Show resolved
Hide resolved
...nterpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
Show resolved
Hide resolved
...nterpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
Show resolved
Hide resolved
|
@Reamer @tbonelee @ParkGyeongTae Could you please check and review it? 🙏 cc/ @seung-00 |
| mvnRepoEnv = mvnRepoUrl; | ||
| } | ||
| if (mvnRepoEnv == null) { | ||
| mvnRepoEnv = "https://repo1.maven.org/maven2/"; |
There was a problem hiding this comment.
nit: This part is a bit hard for me to read due to multiple re-assignments. Would it be better to use a more explicit pattern to clarify?
There was a problem hiding this comment.
Yes, we can handle it with another PR.
| private boolean isForceShutdown = true; | ||
|
|
||
| private ZeppelinConfiguration zConf; | ||
| private Properties zProperties; |
There was a problem hiding this comment.
How about introducing a DTO class within the interpreter module for type safety?
There was a problem hiding this comment.
I like the idea basically but it might grow bigger as we also have interpreter-speicific properties. If we can handle it properly, DTO looks good.
|
For your information, this PR aims to move ZeppelinConfiguration to zengine module. During this process, it causes inefficient changes but I don't want to refactor that part within this PR as I would like to minimize changes. Please feel free to leave those code. I will create new issues and let community handle them as low hanging fruits. 🙏 |
ParkGyeongTae
left a comment
There was a problem hiding this comment.
LGTM 👍
Moving ZeppelinConfiguration out of the shaded module is the right fix for the string literal corruption issue.
I confirmed that Interpreter.setZeppelinConfiguration() (the one removed in this PR) has no remaining callers. The setZeppelinConfiguration references that remain in Note.java, NotebookServer.java, and notebookrepo tests are a different method on a different class, living in unshaded modules — unaffected by this change.
Sounds good on keeping the scope minimal. Happy to pick up the follow-up issues (e.g., parseTimeValue() dedup, config key constants) once they're filed.
Summary
ZeppelinConfigurationfromzeppelin-interpretertozeppelin-zengineso it is no longer included in the shaded interpreter JAR. This prevents the Maven shade plugin from corrupting config string literals, which caused classpath-order-dependent configuration loading failures.ZeppelinConfigurationusage inzeppelin-interpreterwithProperties-based configuration acrossInterpreterLauncher,LifecycleManager,RecoveryStorage,DependencyResolver, and all launcher plugins (Docker, K8s, YARN, Flink).zeppelin-zengine,zeppelin-server,flink, andmarkdowninterpreter modules.TimeoutLifecycleManagerto parse time unit suffixes (e.g.,"10s","1000ms") by addingparseTimeValue(). Previously,Long.parseLong("10s")threwNumberFormatException, causing theTimeoutLifecycleManagerTest.testTimeout_2to enter an infinite loop and hang CI for 6 hours.PersonalizeActionsIT.testGraphActionSelenium test by usingclickAndWait()instead ofclickableWait().click(), allowing the UI to update before assertion.Motivation
ZeppelinConfigurationinzeppelin-interpretergets processed by the Maven shade plugin, which corrupts string literals (e.g.,org.apache.zeppelin→unshaded.org.apache.zeppelin). This causes config keys to mismatch at runtime depending on classpath ordering. Moving it tozeppelin-zengine(which is not shaded) permanently eliminates this class of bugs.As discussed by the community: "ZeppelinConfiguration belongs to the Zeppelin server, and the Zeppelin interpreter should really only work on a HashMap with ConfigKey and ConfigValue."
Changes
zeppelin-interpreter(core)ZeppelinConfigurationimports; usePropertiesfor configInterpreterLauncherZeppelinConfiguration zConf→Properties zPropertiesLifecycleManager/RecoveryStoragePropertiesinstead ofZeppelinConfigurationTimeoutLifecycleManagerparseTimeValue()to handle time unit suffixes ("10s","1000ms")DependencyResolverZeppelinConfigurationProperties-based APIzeppelin-zenginePluginManagerpasses derived values (absolute paths) via PropertiesZeppelinConfiguration.javazeppelin-interpreter→zeppelin-zenginePersonalizeActionsITtestGraphActionby waiting for UI update after clickFuture Work
Some logic was duplicated during this refactoring to keep
zeppelin-interpreterindependent ofZeppelinConfiguration:TimeoutLifecycleManager.parseTimeValue()duplicatesZeppelinConfiguration.timeUnitToMill()— both parse time strings like"10s"or"1000ms"viaDuration.parse("PT" + value). A shared utility inzeppelin-commoncould consolidate this in the future."zeppelin.interpreter.lifecyclemanager.timeout.threshold") are now hardcoded as plain strings inzeppelin-interpreterrather than referencingConfVarsenum constants. If config key management becomes an issue, a lightweight key constants class could be introduced.Test Plan
core.yml- Core module tests (includingTimeoutLifecycleManagerTest)core.yml- Interpreter tests (Spark, Flink)frontend.yml- E2E tests (Playwright + Selenium)quick.yml- RAT license checkZeppelinConfiguration